package com.dap.cms.governance.service.impl;

import com.dap.cms.base.impl.BaseServiceImpl;
import com.dap.cms.governance.po.CmsApplicationFormPo;
import com.dap.cms.governance.service.CmsApplicationFormService;
import com.dap.cms.governance.service.CmsCheckInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @description: cms_application_form表对应的服务接口实现类
 * @author: Fesine
 * @createTime:2018/09/19
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2018/09/19
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class CmsApplicationFormServiceImpl extends BaseServiceImpl<CmsApplicationFormPo>
        implements CmsApplicationFormService {
    @Autowired private CmsCheckInfoService cmsCheckInfoService;

    @Override
    public Boolean checkCmsApplicationFormPo(CmsApplicationFormPo cmsApplicationFormPo) {
        return null == daoService.selectOne(CmsApplicationFormPo.class.getName() + ".selectByStatus", cmsApplicationFormPo);
    }

    @Override
    public void request(CmsApplicationFormPo cmsApplicationFormPo) {
        save(cmsApplicationFormPo);
        cmsApplicationFormPo=get(cmsApplicationFormPo);
        cmsCheckInfoService.add(cmsApplicationFormPo);
    }
}

